# grytole@gmail.com 28-Jun-2012

MODULE = lua

CC = gcc
AR = ar rcu
RANLIB = ranlib
RM = rm -f

CFLAGS = -O2 -Wall -fPIC -DLUA_COMPAT_ALL
IFLAGS = -I$(TOPDIR)/$(MODULE)/inc

SRC_FILES = $(wildcard $(TOPDIR)/$(MODULE)/src/*.c)
OBJ_FILES = $(patsubst %.c,%.o,$(SRC_FILES))
LIB_FILE = lib$(MODULE).a

%.o: %.c
	$(CC) $(CFLAGS) $(IFLAGS) -c $< -o $@

$(LIB_FILE): $(OBJ_FILES)
	$(AR) $@ $^
	$(RANLIB) $@

all: $(LIB_FILE)

clean:
	$(RM) $(LIB_FILE) $(OBJ_FILES)

# eof
